package sec7_scjp1.threads;

public class Objetivo2 extends Thread {
//public class Objetivo2 implements Runnable {

	private int n;
	public Objetivo2(int n){
		this.n = n;
	}
	
	public static void main(String[] args) {

		Objetivo2 td1 = new Objetivo2(1);
		Objetivo2 td2 = new Objetivo2(2);
		Objetivo2 td3 = new Objetivo2(3);
		
		td1.start();
		td2.start();
		td3.start();
	}

	@Override
	public void run() {
		try{
//				 Thread.currentThread().sleep(1000);
//				 System.out.println("looping while");
				Thread.sleep((long)(Math.random()*5)*1000);
		}catch(InterruptedException e){
		}
		System.out.println("Hilo N. "+ n);
		 
	}
	
//	@Override
//	public void run() {
//		try{
//			while(true){
//				this.sleep(1500);
//				System.out.println("Looping While!");
//			}
//		}catch(InterruptedException e){}
//		
//	}
	

}
